/***********************************************
 **** 版权声明处 **
 ****  为了方便阅读和维护，请严格遵守相关代码规范，谢谢   ****
 *******************************************/
package com.hjx.model
{
	import com.hjx.controller.ArticleServiceEvent;
	import com.hjx.model.business.ArticleServiceImplDelegate;
	import com.hjx.model.vo.Page;
	
	import flash.events.EventDispatcher;
	
	import mx.collections.ArrayCollection;
	import mx.controls.Alert;
	import mx.rpc.Responder;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;

	/*******************************************
	 **** @author huangjixin,@date 2012-7-25, @time 下午4:55:09 **
	 **** 请一句话表述该类主要作用  **
	 *******************************************/
	public class ArticleServiceImplRemoteProxy extends EventDispatcher
	{
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// private 类私有静态变量和静态常量声明处。（全部大写，使用下划线进行分割）
		// 例如：private static const EXAMPLE:String = "example";
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// public 类公有静态变量和静态常量声明处。（全部大写，使用下划线进行分割）
		// 例如：public static const EXAMPLE:String = "example";
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		public static const NAME:String = "ArticleServiceImplRemoteProxy";
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// private 私有变量声明处，请以“_”开头定义变量
		// 例如：private var _example:String;
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// public 公有变量声明处
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// 构造函数，初始化相关工作可以放在里面
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		public function ArticleServiceImplRemoteProxy()
		{
		}//构造函数结束
		
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// getter和setter函数
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// 相关事件响应函数和逻辑函数存放处
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		public function selectAll():void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onSelectAllResult, onFault));  
			delegate.selectAll();  
		}  
		
		private function onSelectAllResult(pResultEvt:ResultEvent):void  
		{  
			var result:ArrayCollection=pResultEvt.result as ArrayCollection ;  
			//sendNotification();  
		}  
		
		public function selectByPage(page:Page):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onSelectByPageResult, onFault));  
			delegate.selectByPage(page);  
		}  
		
		private function onSelectByPageResult(pResultEvt:ResultEvent):void  
		{  
			var result:Page=pResultEvt.result as Page ;  
			dispatchEvent(new ArticleServiceEvent(ArticleServiceEvent.SELECT_BY_PAGE_RESULT,result));    
		}  
		
		public function deleteByPrimaryKey(id:int):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onDeleteByPrimaryKeyResult, onFault));  
			delegate.deleteByPrimaryKey(id);  
		}  
		
		private function onDeleteByPrimaryKeyResult(pResultEvt:ResultEvent):void  
		{  
			var result:int=pResultEvt.result as int ;  
			//sendNotification();  
		}  
		
		public function insert(record:Object):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onInsertResult, onFault));  
			delegate.insert(record);  
		}  
		
		private function onInsertResult(pResultEvt:ResultEvent):void  
		{  
			var result:int=pResultEvt.result as int ;  
			//sendNotification();  
		}  
		
		public function insertSelective(record:Object):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onInsertSelectiveResult, onFault));  
			delegate.insertSelective(record);  
		}  
		
		private function onInsertSelectiveResult(pResultEvt:ResultEvent):void  
		{  
			var result:int=pResultEvt.result as int ;  
			//sendNotification();  
		}  
		
		public function selectByPrimaryKey(id:int):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onSelectByPrimaryKeyResult, onFault));  
			delegate.selectByPrimaryKey(id);  
		}  
		
		private function onSelectByPrimaryKeyResult(pResultEvt:ResultEvent):void  
		{  
			var result:Object=pResultEvt.result as Object ;  
			//sendNotification();  
		}  
		
		public function updateByPrimaryKeySelective(record:Object):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onUpdateByPrimaryKeySelectiveResult, onFault));  
			delegate.updateByPrimaryKeySelective(record);  
		}  
		
		private function onUpdateByPrimaryKeySelectiveResult(pResultEvt:ResultEvent):void  
		{  
			var result:int=pResultEvt.result as int ;  
			//sendNotification();  
		}  
		
		public function updateByPrimaryKey(record:Object):void  
		{  
			var delegate:ArticleServiceImplDelegate = new ArticleServiceImplDelegate(new Responder(onUpdateByPrimaryKeyResult, onFault));  
			delegate.updateByPrimaryKey(record);
		}  
		
		private function onUpdateByPrimaryKeyResult(pResultEvt:ResultEvent):void  
		{  
			var result:int=pResultEvt.result as int ;  
			//sendNotification();  
		}  
		
		private function onFault(pFaultEvt:FaultEvent):void  
		{  
			Alert.show(pFaultEvt.fault.faultString, 'Error');  
		}  
		
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
		// override 覆盖函数
		//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
	}//类结束
}//包结束